-- burn
-- created by panyl
-- 燃烧状态

return {
    apply = function(prop, baseValue)
        return prop[3];
    end,

    -- 每回合触发
    trigger = function(who, prop, arg)
        local damage = prop[3];

        -- 降低中毒燃烧伤害
        local p = PropM.combine(who, "poisoned_resist", 1);
        damage = PropM.apply(p, damage);

        -- 火抗
        p = PropM.combine(who, "burn_resist", 1);
        damage = PropM.apply(p, damage);

        -- 最小一点
        damage = math.max(1, damage);
        
        -- 专属免疫
        local arr = PropM.combine(who, "immunity2", PropM.getPropId("burn"));
        if PropM.apply(arr, damage) > 0 then
            return 0;
        end

        return CombatM.receiveDamage(who, who, damage, 0);
    end,

    record = function(target, prop, path)
        return false;
    end
};